package co.yixiang.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * WebSocket配置类，用于注册WebSocket的端点
 */
@Configuration(proxyBeanMethods = false)
public class WebSocketConfig {

    /**
     * 创建并注册ServerEndpointExporter bean
     * ServerEndpointExporter的作用是将标记了@ServerEndpoint注解的类
     * 注册为WebSocket端点，它会自动扫描并初始化这些端点
     *
     * @return ServerEndpointExporter实例
     */
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

}
